using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Reap.AzureResource.Model.Models.Mapping
{
    public class LocationMap : EntityTypeConfiguration<Location>
    {
        public LocationMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.FuserName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Fmail)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FUrl)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Location");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.FtypeID).HasColumnName("FtypeID");
            this.Property(t => t.FuserName).HasColumnName("FuserName");
            this.Property(t => t.Fmail).HasColumnName("Fmail");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.Fstatus).HasColumnName("Fstatus");
            this.Property(t => t.FUrl).HasColumnName("FUrl");
        }
    }
}
